package com.aynu.webshop.web.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.aynu.webshop.core.generic.GenericDao;
import com.aynu.webshop.core.generic.GenericServiceImpl;
import com.aynu.webshop.web.dao.AdminMapper;
import com.aynu.webshop.web.model.Admin;
import com.aynu.webshop.web.service.AdminService;

@Service
public class AdminServiceImpl extends GenericServiceImpl<Admin, Integer> implements AdminService {

	@Resource
	private AdminMapper adminMapper;
	
	@Override
	public int insert(Admin model) {
		// TODO Auto-generated method stub
		return adminMapper.insertSelective(model);
	}

	@Override
	public int update(Admin model) {
		// TODO Auto-generated method stub
		return adminMapper.updateByPrimaryKeySelective(model);
	}

	@Override
	public int delete(Integer id) {
		// TODO Auto-generated method stub
		return adminMapper.deleteByPrimaryKey(id);
	}

	@Override
	public Admin selectById(Integer id) {
		// TODO Auto-generated method stub
		return adminMapper.selectByPrimaryKey(id);
	}

	@Override
	public Admin selectOne() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Admin> selectList() {
		// TODO Auto-generated method stub
		return adminMapper.findAll();
	}

	@Override
	public GenericDao<Admin, Integer> getDao() {
		// TODO Auto-generated method stub
		return adminMapper;
	}

	@Override
	public Admin findByAname(String getuName) {
		// TODO Auto-generated method stub
		return adminMapper.findByAname(getuName);
	}

}
